package com.gisuni.sddc.controller;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.codehaus.jackson.map.ObjectMapper;
import org.json.JSONObject;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.GET;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;

import com.gisuni.sddc.service.RegulatePlanService;
import com.gisuni.sddc.service.UserOrganizationService;
import com.gisuni.sddc.model.Organization;
import com.gisuni.sddc.model.Response;
import com.gisuni.sddc.model.UserOrganization;

@IocBean(singleton = false)
@At("/client/service/regulatePlanController")
public class RegulatePlanController {

	private Log log = Logs.getLog(RegulatePlanController.class);

	@Inject
	private RegulatePlanService  regulatePlanService;
	/**
	 * 查询所有人员-组织数据
	 * @return
	 */
	@At("/queryKGContentByInput")
	@GET
	@POST
	@Ok("json")
	public Object queryKGContentByInput(@Param("inputText") String inputText,HttpServletRequest request) {
		Response res = new Response();
		res.setSuccess(false);
		List<Map<String,Object>> list = new ArrayList<Map<String,Object>>();
		try {
			list = regulatePlanService.queryKGContentByInput(inputText);
			res.setResult(list);
		} catch (Exception e) {
			log.error(e.getMessage());
		}
		return res;
	}
}
